import java.util.Scanner;

public class Work {
    public static void main1(String[] args) {
        //打印1-100出现数字9的每个数，并统计次数
        int count = 0;
        for (int i = 1; i <= 100; i++) {
            if (i % 10 == 9 || i / 10 == 9) {
                System.out.print(i+" ");
                count++;
            }
        }
        System.out.println();
        System.out.println("出现数字9的个数是：" + count);
    }

    //判定一个数是否是素数
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数：");
        int num = sc.nextInt();
        boolean flag = true;
        for (int i = 2; i < num; i++) {
            if (num % i == 0) {
                flag = false;
                break;
            }
        }
        if (flag) {
            System.out.print(num + "是素数");
        }
    }
}
